<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>{$appConfigs.title}</title>
    <link rel="stylesheet" type="text/css" href="{$contextPath}/pas/easyui/themes/{$page_theme | default: 'default'}/easyui.css">
    <link rel="stylesheet" type="text/css" href="{$contextPath}/pas/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="{$contextPath}/pas/easyui/themes/color.css">
    <link rel="stylesheet" type="text/css" href="{$contextPath}/pas/editor/themes/default/default.css" />
    
    <script type="text/javascript" src="{$contextPath}/pas/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="{$contextPath}/pas/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="{$contextPath}/pas/easyui/jquery.easyui.patch.js"></script>
    <script type="text/javascript" src="{$contextPath}/pas/editor/kindeditor-min.js"></script>
    <script type="text/javascript" src="{$contextPath}/pas/editor/lang/zh_CN.js"></script>
</head> 
<body onpageshow="resetPagination()">
    <table id="dg" title="所有信息" class="easyui-datagrid" style="width:99%;height:95%"
            url="{$contextPath}/cms/content/findRemoves.xdo?code={$Request.code}"
            toolbar="#toolbar" pagination="true" pageSize="15" pageList="[15,30]"
            rownumbers="true" fitColumns="true" singleSelect="false">
        <thead>
            <tr>
                <th field="category_name" width="40">栏目</th>
                <th field="title" width="50">标题</th>
                <th field="tag" width="50">标签</th>
                <th field="sort_id" width="30" align="right">排序</th>
                <th field="status" width="30" data-options="formatter:{literal}function(v){return v=='1'?'已发布':'<font color=red>未发布</font>'}{/literal}">状态</th>
                <th field="publish_date" width="30">发布时间</th>
                <th field="create_date" width="30">创建时间</th>
            </tr>
        </thead>
    </table>
    <div id="toolbar">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="unremoveOne()">取消删除</a>
    </div>
    
    <div id="dlg" class="easyui-dialog" style="width:800px; height:470px;padding:10px 20px"
            closed="true" buttons="#dlg-buttons">
        <div class="ftitle">信息</div>
    </div>
    <div id="dlg-buttons">
        <a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveOne()" style="width:90px">保存</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">取消</a>
    </div>
    <script type="text/javascript">
    var category_id = '{$categoryObject.category_id}';
    var category_code='{$categoryObject.code}';
    {literal}
        var url;
        function unremoveOne(){
            var selections = $('#dg').datagrid('getSelections');
            if (selections.length > 0 ){
            	var rows = new Array();
            	for(var i=0; i< selections.length; i++){
            		rows.push(selections[i].content_id);
            	}
                $.messager.confirm('Confirm','删除后数据不能恢复，确认删除么?',function(r){
                    if (r){
                        $.post('/cms/content/unremove.xdo',{content_id:rows},function(result){
                            if (result.success){
                                $('#dg').datagrid('reload');    // reload the user data
                            } else {
                                $.messager.show({    // show error message
                                    title: 'Error',
                                    msg: result.errorMsg
                                });
                            }
                        },'json');
                    }
                });
            }
        }
		function resetPagination(){
			var p = $('#dg').datagrid('getPager');
			$(p).pagination({             
				pageSize: 15,           
		 		pageList: [15,30],
				beforePageText: '第',      
				afterPageText: '页    共 {pages} 页',             
				displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'                  
			}); 
		}
    </script>
    <script type="text/javascript">
        //编辑器
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('textarea[name="content"]', {
                allowFileManager: false,
                resizeType: 1,
                allowPreviewEmoticons: false,
                items: [
                    'preview', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
                    'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                    'insertunorderedlist', '|', 'emoticons', 'image', 'link', 'fullscreen'],
                afterChange: function () {
                    this.sync();
                }
            });
        });
    </script>
    <style type="text/css">
        #fm{
            margin:0;
            padding:10px 30px;
        }
        .ftitle{
            font-size:14px;
            font-weight:bold;
            padding:5px 0;
            margin-bottom:10px;
            border-bottom:1px solid #ccc;
        }
        .fitem{
            margin-bottom:5px;
        }
        .fitem label{
            display:inline-block;
            width:80px;
        }
        .fitem input{
            width:160px;
        }
    </style>
    {/literal}
</body>
</html>